Developer Documentation
PATHJava Developer Documentation > Mac OS Runtime for Java > MRJToolkit > Programming With MRJToolkit


Methods


isMRJToolkitAvailable

Checks for the presence of MRJToolkit.

public static final boolean isMRJToolkitAvailable();
method result
True if MRJToolkit is present on the host platform, false otherwise.

DISCUSSION

You can include this method only if you are building your application with the version of MRJToolkit included with the MRJ 2.0 SDK or later. However, it will still return the correct value (true) when called on host platforms running MRJ 1.5.


registerAboutHandler

Registers the handler method to be called when the About menu item is selected.

public static final void registerAboutHandler (
                     MRJAboutHandler handler);
handler
The name of the object that implements the handleAbout method.

DISCUSSION

You must have defined the handler method before calling this method. If you do not register the handler method, selecting the About menu item does nothing.

The default About menu item included in the Apple menu, while usable, should be replaced to conform to Apple's human interface guidelines; you do so by defining a new menu (in a resource of type 'MENU' with ID 1128) when you package your application.

SEE ALSO

The handleAbout method handleAbout .


registerOpenDocumentHandler

Registers the handler method to be called when the application receives a request to open a document.

public static final void registerOpenDocumentHandler (
                     MRJOpenDocumentHandler handler);
handler
The name of the method that handles the file drop event.

DISCUSSION

You must have defined the handler before calling this method.

SEE ALSO

The handleOpenFile method handleOpenFile .


registerPrintDocumentHandler

Registers the handler method to be called when the user requests that a document be printed from the Finder.

public static final void registerPrintDocumentHandler (
                     MRJPrintDocumentHandler handler);
handler
The name of the method that handles the print request.

DISCUSSION

You may not be able to fully implement a print handler method due to lack of printing support in JDK 1.0.2 or earlier. You must have defined the handler method before calling this method.

SEE ALSO

The myHandlePrintFile method myHandlePrintFile .


registerQuitHandler

Registers the handler method to be called when the application receives a request to quit.

public static final void registerQuitHandler (
                     MRJQuitHandler handler);
handler
The name of the method that handles the quit request.

DISCUSSION

You must have defined the handler method before calling this method.

Java applications packaged with JBindery have a default Quit selection in the Apple Menu. However, to conform to Apple's human interface guidelines, you should replace the default Apple Menu (by defining a new menu in a resource of type 'MENU' with ID 1128 when you package your application) and include a Quit selection in one of the Java-based menus (typically the File menu).

SEE ALSO

The handleQuit method handleQuit .


© 1998 Apple Computer, Inc. — (Last Updated 10 Dec 98)